from django.conf import settings
from math import floor
from random import seed, random
seed()

class Base():
    name    = 'base controller'

    def __init__(self, model):
        self.model   = model
    
    def get_model(self):
        return self.model

class Planet(Base):

    name = 'planet'

    def generate_size(self):
        size    = settings.PLANET_SIZE_BY_POSITION[self.model.position]
        delta   = size[2] - size[1]
        size    = size[1] + int(floor(delta * random()))
        return size

